begintownscript;

variables;
short choice;

body;

beginstate 0; //INIT_STATE

	if(get_flag(8,0) == 0) {
		//passed out on the shore
		relocate_character(0,12,11);
		relocate_character(1,14,12);
		relocate_character(2,15,10);
		relocate_character(3,13,11);
		relocate_character(4,10,12);
		set_character_pose(1000,14);
		force_view_center(12,11);
		force_instant_terrain_redraw();
		pause(15);
		
		reset_dialog();
		add_dialog_str(0,"Eventually, you catch your breath and wring out your equipment. Time to find your way back to Stonesthrow and report your success.",0);
		run_dialog(1);
		
		pause(5);
		set_character_pose(1000,0);
		set_character_facing(1000,4);
		force_instant_terrain_redraw();
		change_outdoor_location(2,0,27,11);
		
		//set up all the outdoor flags
		set_flag(52,1,3);
		set_flag(53,1,1);
		set_flag(54,0,1);
		set_flag(55,0,1);
		set_flag(55,3,1);
		
		set_flag(8,0,1);
		}

break;

beginstate 1; //EXIT_STATE

	reset_dialog();
	add_dialog_str(0,"As you set off along the beach, you see the Loyalist ships retreating towards the open sea. This is, to say the least, a good sign. It seems that you have been successful.",0);
	add_dialog_str(1,"Now all that remains is to collect your reward.",0);
	run_dialog(1);
	set_flag(8,1,1);

break;

beginstate 2; //START_STATE
	//Checking for the lead pc each turn... not necessary here
	//pc_counter = 0;
	//while(char_ok(pc_counter) == 0) {
	//	pc_counter = pc_counter + 1;
	//	}
	//lead_char = pc_counter;
break;